package action;

import java.util.List;


import beans.Package;

import com.opensymphony.xwork2.ActionSupport;

import dao.PackageDao;

@SuppressWarnings("serial")
public class getPackageDetailsByBoxNumAction extends ActionSupport {

	private int boxNum;
	private int terminalID;

	PackageDao packageDao;
	List<Package> packages = null;

	public String execute() {
		// fetch package details by box number
		packageDao = new PackageDao();
		packages = packageDao.getPacakgeDetailsByBoxNum(terminalID, boxNum);
		System.out.println("-----------------------------------------------");
		if (packages.iterator().hasNext())
			System.out.println("boxNum: " + boxNum);
//		for (Package p : packages) {
//			p.print();
//		}
		return "success";
	}

	public int getBoxNum() {
		return boxNum;
	}

	public void setBoxNum(int boxNum) {
		this.boxNum = boxNum;
	}

	public List<Package> getPackages() {
		return packages;
	}

	public void setPackages(List<Package> packages) {
		this.packages = packages;
	}

	public int getTerminalID() {
		return terminalID;
	}

	public void setTerminalID(int terminalID) {
		this.terminalID = terminalID;
	}

}
